					<form method="post" id="master_room" action="#">
						<!--div class="form-group"-->
							<div class="col-sm-5"><label for="lantai" class="control-label">Floor<span style="color:red;">*</span></label></div>
							<div class="col-sm-7">
								<select id="floor_name" class="form-control input-sm required" onchange="javascript:getRoom()">                         
									<option value="0">-- select --</option>									
								<?php
									if (!empty($floor_name)) { 
										foreach($floor_select as $floor_select => $key)
										{ ?>
											<option value="<?php echo $key['MST_FLOOR_DESC']; ?>"<?php echo ($floor_name == $key['MST_FLOOR_DESC']) ? 'selected' : ''; ?>><?php echo $key['MST_FLOOR_DESC']; ?></option>									
										<?php
										}
									} else {
										foreach($floor_select as $floor_select => $key)
										{ ?>
											<option value="<?php echo $key['MST_FLOOR_DESC']; ?>"><?php echo $key['MST_FLOOR_DESC']; ?></option>									
										<?php
										}		
									}
								?>															
								</select>						
							</div>
						<!--/div-->
						<!--div class="form-group"-->
							<div class="col-sm-5"><label for="kode_jabatan2" class="control-label">Job Position<span style="color:red;">*</span></label></div>
							<div class="col-sm-7">
								<select id="nama_jabatan2" class="form-control input-sm required">                         
									<option value="0">-- select --</option>
								<?php
									if (!empty($nama_jabatan2)) { 
										foreach($job_select2 as $job_select2 => $key)
										{ ?>
											<option value="<?php echo $key['JOB']; ?>"<?php echo (strtoupper($nama_jabatan2) == strtoupper($key['JOB'])) ? 'selected' : ''; ?>><?php echo $key['JOB']; ?></option>									
										<?php
										}
									} else {
										foreach($job_select2 as $job_select2 => $key)
										{ ?>
											<option value="<?php echo $key['JOB']; ?>"><?php echo $key['JOB']; ?></option>									
										<?php
										}		
									}
								?>
								</select>						
							</div>
						<!--/div-->
						<div class="form-group" id="ruang_select">
							<div class="col-sm-5"><label for="ruang" class="control-label">Room Name</label></div>
							<div class="col-sm-7">
								<select id="ruang_name" class="form-control input-sm">                         
									<?php
									if (!empty($ruang_name)) { ?>
										<option value="0">-- select --</option>
										<option value="<?php echo $ruang_name; ?>"<?php echo ($ruang_name == $ruang_name) ? 'selected' : ''; ?>><?php echo $ruang_name; ?></option>										
									<?php										
									} else {
									?>
										<option disabled="disabled" value="0">-- select floor first --</option>											
									<?php
									} ?>
								</select>												
							</div>													
							<div class="col-sm-5"><label align="right" for="l_new_room" class="control-label input-sm">New Name<span style="color:red;">*</span></label></div>						
							<div class="col-sm-7">
								<?php
								if (!empty($new_room)) { ?>
									<input type="text" class="form-control input-sm" id="new_room" value="<?php echo $new_room; ?>"> 
								<?php										
								} else {
								?>
									<input type="text" class="form-control input-sm" id="new_room" value=""> <!-- disabled="disabled" -->									
								<?php
								} ?>							
							</div>
						</div>
						<div class="col-sm-8">&nbsp;</div>
						<div class="col-sm-8" style="margin-top:2px;">&nbsp;</div>
						<div class="col-sm-4">
							<button type="button" class="btn btn-primary btn-block" onclick="search_data2();">
							<!--span class="glyphicon glyphicon-search"></span--> Search</button>
						</div>
						<div style="margin-top:20px" class="col-sm-8"><label for="room_facility2" class="control-label"><b class="caret"></b> All Facility Request</label></div>
						<div class="col-md-12">
							<div class="table-responsive">
							<table class="table table-bordered table-condensed table-striped">
								<thead><tr>
									<th>No</th>
									<th>Name</th>
									<?php
										if (!empty($list_data3) || !empty($list_data4)) {
									?>
											<th>Type</th>
									<?php
										}
									?>
									<th>Status</th>
									<?php
										if (!empty($list_data3) || !empty($list_data4)) {
									?>
											<th>Action</th>
									<?php
										}
									?>
								</tr></thead>
								<tbody>
									<?php
										if (empty($list_data3) && (empty($floor_name) || empty($nama_jabatan2))) {
											?>
											<tr><td colspan="4" style="text-align:center">No Data Available</td></tr>
											<?php
										} else if (!empty($list_data3) && empty($ruang_name)) {
											$no_urut = 0; 
											foreach ($list_data3 as $row) {
												$no_urut++;
											?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut; ?>.</td>
													<td style="text-align:left;"><?php echo $row['RI_NAME']; ?></td>
													<td style="text-align:left;"><?php echo $row['RI_TYPE']; ?></td>
													<td>
														<select id="ri_status<?php echo $no_urut; ?>" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y"<?php echo (strtoupper($row['RI_STATUS']) == 'Y') ? 'selected' : ''; ?>>Active</option>
															<option value="N"<?php echo (strtoupper($row['RI_STATUS']) == 'N') ? 'selected' : ''; ?>>Not Active</option>															
														</select>								
													</td>
													<td>
													<a class="btn btn-sm btn-warning" href="#" onclick="edit_data3('<?php echo $row['RI_ID']; ?>','<?php echo $row['RI_TYPE']; ?>','<?php echo $no_urut; ?>');">
														<!--span class="glyphicon glyphicon-edit"></span--> Edit</a>
													<a class="btn btn-sm btn-danger" href="#" onclick="delete_data3('<?php echo $row['RBL_ID']; ?>','<?php echo $row['RI_NAME']; ?>');">
														<!--span class="glyphicon glyphicon-remove"></span--> Delete</a>
													</td>										
												</tr>
											<?php
											}
											
											if (!empty($list_fasilitas_request)) { ?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut+1; ?>.</td>
													<td>
														<select id="work_awal3" class="form-control input-sm">                         
															<option value="0">-- select--</option>
														<?php 
															foreach($list_fasilitas_request as $key)
															{
																echo '<option value="'.$key['RI_ID'].'">'.$key['RI_NAME'].'</option>';
															} 
														?>							
														</select>
													</td>
													<td></td>
													<td>
														<select id="status_awal3" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y">Active</option>
															<option value="N">Not Active</option>															
														</select>
													</td>
													
													<?php
													if (!empty($floor_name)) {
													?>
														<td>
															<a class="btn btn-sm btn-success" href="#" onclick="add_data3();">
															<!--span class="glyphicon glyphicon-plus"></span--> Add</a>
														</td>
													<?php
													}
													?>
													
												</tr>
											<?php
											} 	
											 
										} else if ((!empty($list_data3) || !empty($list_data4)) && !empty($ruang_name)) {
											$no_urut = 0; 
											foreach ($list_data3 as $row) {
												$no_urut++;
											?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut; ?>.</td>
													<td style="text-align:left;"><?php echo $row['RI_NAME']; ?></td>
													<td style="text-align:left;"><?php echo $row['RI_TYPE']; ?></td>
													<td>
														<select id="ri_status<?php echo $no_urut; ?>" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y"<?php echo (strtoupper($row['RI_STATUS']) == 'Y') ? 'selected' : ''; ?>>Active</option>
															<option value="N"<?php echo (strtoupper($row['RI_STATUS']) == 'N') ? 'selected' : ''; ?>>Not Active</option>															
														</select>								
													</td>
													<td>
													<a class="btn btn-sm btn-warning" href="#" onclick="edit_data3('<?php echo $row['RI_ID']; ?>','<?php echo $row['RI_TYPE']; ?>','<?php echo $no_urut; ?>');">
														<!--span class="glyphicon glyphicon-edit"></span--> Edit</a>
													<a class="btn btn-sm btn-danger" href="#" onclick="delete_data3('<?php echo $row['RBL_ID']; ?>','<?php echo $row['RI_NAME']; ?>');">
														<!--span class="glyphicon glyphicon-remove"></span--> Delete</a>
													</td>
												</tr>
											<?php
											}
											
											foreach ($list_data4 as $row) {
												$no_urut++;
											?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut; ?>.</td>
													<td style="text-align:left;"><?php echo $row['RI_NAME']; ?></td>
													<td style="text-align:left;"><?php echo $row['RI_TYPE']; ?></td>
													<td>
														<?php
															// if(strtoupper($row['RI_STATUS']) == 'Y'){echo 'Active';} else {echo 'Not Active';}
														?>
														<select id="ri_status<?php echo $no_urut; ?>" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y"<?php echo (strtoupper($row['RI_STATUS']) == 'Y') ? 'selected' : ''; ?>>Active</option>
															<option value="N"<?php echo (strtoupper($row['RI_STATUS']) == 'N') ? 'selected' : ''; ?>>Not Active</option>															
														</select>								
													</td>
													<td>
													<a class="btn btn-sm btn-warning" href="#" onclick="edit_data3('<?php echo $row['RI_ID']; ?>','<?php echo $row['RI_TYPE']; ?>','<?php echo $no_urut; ?>');">
														<!--span class="glyphicon glyphicon-edit"></span--> Edit</a>
													<a class="btn btn-sm btn-danger" href="#" onclick="delete_data3('<?php echo $row['RBL_ID']; ?>','<?php echo $row['RI_NAME']; ?>');">
														<!--span class="glyphicon glyphicon-remove"></span--> Delete</a>
													</td>													
												</tr>
											<?php
											}
											
											if (!empty($list_fasilitas_request)) { ?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut+1; ?>.</td>
													<td>
														<select id="work_awal3" class="form-control input-sm">                         
															<option value="0">-- select--</option>
														<?php 
															foreach($list_fasilitas_request as $key)
															{
																echo '<option value="'.$key['RI_ID'].'">'.$key['RI_NAME'].'</option>';
															} 
														?>							
														</select>
													</td>
													<td></td>
													<td>
														<select id="status_awal3" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y">Active</option>
															<option value="N">Not Active</option>															
														</select>
													</td>
													
													<?php
													if (!empty($floor_name)) {
													?>
														<td>
															<a class="btn btn-sm btn-success" href="#" onclick="add_data3();">
															<!--span class="glyphicon glyphicon-plus"></span--> Add</a>
														</td>
													<?php
													}
													?>
													
												</tr>
											<?php
											} 
										
										} else {
									?>
											<tr>
												<td style="text-align:center;">1.</td>
												<td>
													<select id="work_awal3" class="form-control input-sm">                         
														<option value="0">-- select --</option>
													<?php 
														foreach($list_fasilitas_request as $keys)
														{
															echo '<option value="'.$keys['RI_ID'].'">'.$keys['RI_NAME'].'</option>';
														} 
													?>							
													</select>
												</td>
												<td>
													<select id="status_awal3" class="form-control input-sm">                         
														<option value="">-- select --</option>
														<option value="Y">Active</option>
														<option value="N">Not Active</option>															
													</select>
												</td>												
											</tr>
									<?php
										}
									?>
									
								</tbody>
							</table>
							</div>
						</div>
						<div class="col-sm-8"></div>
						<div class="col-sm-4">
							<?php
							if (empty($list_data3) && empty($list_data4) && !empty($floor_name)) {
							?>
								<button type="button" class="btn btn-success btn-block" onclick="add_data3();">
								<!--span class="glyphicon glyphicon-plus"></span--> Add New</button>
							<?php
							} else if (empty($list_data3) && empty($floor_name)) {
							?>
								<button type="button" class="btn btn-default btn-block" >No Action</button>
							<?php
							} 
							?>
						</div>
					</form>